using ASP;
using HoWave.Common;
using HoWave.Web;
using HoWave.Web.Admin;
using System;
using System.Data;
using System.Web.Profile;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
public class HL_Admin_Admin_Application : Admin, IRequiresSessionState
{
	protected ScriptManager ScriptManager1;
	protected HyperLink PersonIdentify;
	protected Literal CompanyName;
	protected Literal ltrCompanyType;
	protected Literal ltrProvinceCityArea;
	protected Literal CompanyAddrss;
	protected Literal LienceName;
	protected Literal CompanyRange;
	protected Literal LienceNum;
	protected Literal Fax;
	protected Literal ContacterName;
	protected Literal ContacterIDNum;
	protected Literal ContacterPhone;
	protected Literal ContacterMobilePhone;
	protected Literal Email;
	protected Image LienceImg;
	protected RadioButtonList Status;
	protected TextBox Remark;
	protected Literal Checker;
	protected HiddenField IdentifyID;
	protected HiddenField UploadImageUrl;
	protected Label err_tips;
	protected Button BtnConfirm;
	private int _m_userID = 0;
	private int _m_type = 0;
	protected DefaultProfile Profile
	{
		get
		{
			return (DefaultProfile)this.Context.Profile;
		}
	}
	protected global_asax ApplicationInstance
	{
		get
		{
			return (global_asax)this.Context.ApplicationInstance;
		}
	}
	public int m_userID
	{
		get
		{
			this._m_userID = Fetch.GetID("userid");
			return this._m_userID;
		}
	}
	public int m_type
	{
		get
		{
			this._m_type = Fetch.GetID("type");
			return this._m_type;
		}
	}
	protected void Page_Load(object sender, EventArgs e)
	{
		if (!base.IsPostBack)
		{
			if (!base.admin.CheckAdminPower(5))
			{
				base.WriteLog("View", Language.GetAdminMsg("Log/Access", this.m_userID.ToString()), "CompanyCheck");
				base.WriteRightErrMsg();
			}
			this.Checker.Text = base.admin.AdminName;
			this.InitPage();
		}
	}
	protected void InitPage()
	{
		this.PersonIdentify.NavigateUrl = "Admin_ShopIdentifyUser.aspx?type=1&userid=" + this.m_userID.ToString();
		Shop_Application shop_Application = new Shop_Application(this.conn);
		DataTable applicationByUserIDType = shop_Application.GetApplicationByUserIDType(this.m_userID, this.m_type);
		if (applicationByUserIDType.Rows.Count >= 1)
		{
			string[] contentArray = applicationByUserIDType.Rows[0]["IdentifyDetail"].ToString().Split(new char[]
			{
				'$'
			});
			this.CompanyName.Text = Shop_Application.GetContentByName("CompanyName", contentArray);
			this.ltrCompanyType.Text = Shop_Application.GetContentByName("CompayType", contentArray);
			this.LienceName.Text = Shop_Application.GetContentByName("CompanylicenseName", contentArray);
			this.CompanyRange.Text = Shop_Application.GetContentByName("CompanyRange", contentArray);
			this.LienceNum.Text = Shop_Application.GetContentByName("CompanylicenseNum", contentArray);
			this.ContacterName.Text = Shop_Application.GetContentByName("ContacterName", contentArray);
			this.ContacterPhone.Text = Shop_Application.GetContentByName("ContacterPhone", contentArray);
			this.ContacterMobilePhone.Text = Shop_Application.GetContentByName("ContacterMobile", contentArray);
			this.Email.Text = Shop_Application.GetContentByName("ContacterEmail", contentArray);
			this.Fax.Text = Shop_Application.GetContentByName("ContacterFax", contentArray);
			string contentByName = Shop_Application.GetContentByName("CompanyProvince", contentArray);
			string contentByName2 = Shop_Application.GetContentByName("CompanyCity", contentArray);
			string contentByName3 = Shop_Application.GetContentByName("CompanyArea", contentArray);
			this.ltrProvinceCityArea.Text = contentByName + contentByName2 + contentByName3;
			this.CompanyAddrss.Text = Shop_Application.GetContentByName("CompanyAddress", contentArray);
			this.ContacterIDNum.Text = Shop_Application.GetContentByName("ContacterIDCardNum", contentArray);
			string text = Shop_Application.GetContentByName("CompanylicenseUpload", contentArray);
			if (string.IsNullOrEmpty(text))
			{
				text = "/Images/show_nopic.gif";
			}
			else
			{
				text = text.Replace('\\', '/');
			}
			this.UploadImageUrl.Value = text;
			this.LienceImg.ImageUrl = text;
			this.Status.Text = applicationByUserIDType.Rows[0]["Status"].ToString();
			this.IdentifyID.Value = applicationByUserIDType.Rows[0]["IdentifyID"].ToString();
			this.Remark.Text = applicationByUserIDType.Rows[0]["Remark"].ToString();
		}
		else
		{
			this.LienceImg.ImageUrl = "/Images/show_nopic.gif";
			this.WriteErrMsg("", "您还没有申请企业认证信息？", "Admin_ShopUserCheck.aspx");
		}
	}
	protected void BtnConfirm_Click(object sender, EventArgs e)
	{
		string text = this.Remark.Text;
		int status = int.Parse(this.Status.SelectedValue);
		string text2 = this.Checker.Text;
		int num = 0;
		if (this.IdentifyID.Value != "" && Text.IsNumber(this.IdentifyID.Value))
		{
			num = int.Parse(this.IdentifyID.Value);
		}
		Shop_Application shop_Application = new Shop_Application(this.conn);
		if (num != 0)
		{
			bool flag = Shop_Application.instance.CheckUpdateApplication(this.m_userID, num, this.m_type, text, text2, status);
			if (flag)
			{
				this.WriteSuccessMsg("", Language.GetAdminMsg("Common/EditSuccess"), "Admin_ShopUserCheck.aspx");
			}
		}
	}
}
